package com.liuyanzhao.blog.entity.custom;


import com.liuyanzhao.blog.util.others.Page;

import java.util.List;

/**
 * 用于封装搜索的文章列表，包括文章信息，作者信息，分类信息，标签信息，搜索信息
 */
public class ArticleSearchVo {
	//文章信息
	private ArticleCustom articleCustom;
	
	//文章对应的分类
	private List<CategoryCustom> categoryCustomList;
	
	//文章对应的标签
	private List<TagCustom> tagCustomList;

	//作者信息
	private UserCustom userCustom;

	//文章分页信息
	private Page page;

	//搜索关键词
	private String query;

	public String getQuery() {
		return query;
	}

	public UserCustom getUserCustom() {
		return userCustom;
	}

	public void setUserCustom(UserCustom userCustom) {
		this.userCustom = userCustom;
	}

	public void setQuery(String query) {
		this.query = query;
	}


	public ArticleCustom getArticleCustom() {
		return articleCustom;
	}
	
	public void setArticleCustom(ArticleCustom articleCustom) {
		this.articleCustom = articleCustom;
	}

	public List<CategoryCustom> getCategoryCustomList() {
		return categoryCustomList;
	}

	public void setCategoryCustomList(List<CategoryCustom> categoryCustomList) {
		this.categoryCustomList = categoryCustomList;
	}

	public List<TagCustom> getTagCustomList() {
		return tagCustomList;
	}

	public void setTagCustomList(List<TagCustom> tagCustomList) {
		this.tagCustomList = tagCustomList;
	}

	public Page getPage() {
		return page;
	}
	
	public void setPage(Page page) {
		this.page = page;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((articleCustom == null) ? 0 : articleCustom.hashCode());
		result = prime * result + ((categoryCustomList == null) ? 0 : categoryCustomList.hashCode());
		result = prime * result + ((page == null) ? 0 : page.hashCode());
		result = prime * result + ((query == null) ? 0 : query.hashCode());
		result = prime * result + ((tagCustomList == null) ? 0 : tagCustomList.hashCode());
		result = prime * result + ((userCustom == null) ? 0 : userCustom.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ArticleSearchVo other = (ArticleSearchVo) obj;
		if (articleCustom == null) {
			if (other.articleCustom != null)
				return false;
		} else if (!articleCustom.equals(other.articleCustom))
			return false;
		if (categoryCustomList == null) {
			if (other.categoryCustomList != null)
				return false;
		} else if (!categoryCustomList.equals(other.categoryCustomList))
			return false;
		if (page == null) {
			if (other.page != null)
				return false;
		} else if (!page.equals(other.page))
			return false;
		if (query == null) {
			if (other.query != null)
				return false;
		} else if (!query.equals(other.query))
			return false;
		if (tagCustomList == null) {
			if (other.tagCustomList != null)
				return false;
		} else if (!tagCustomList.equals(other.tagCustomList))
			return false;
		if (userCustom == null) {
			if (other.userCustom != null)
				return false;
		} else if (!userCustom.equals(other.userCustom))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "ArticleSearchVo [articleCustom=" + articleCustom + ", categoryCustomList=" + categoryCustomList
				+ ", tagCustomList=" + tagCustomList + ", userCustom=" + userCustom + ", page=" + page + ", query="
				+ query + "]";
	}
	
	
	
}
